package com.ucode.application.form.crm;

import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.Length;
import com.ucode.springboot.starter.web.validator.annotation.CheckMember;
import com.ucode.springboot.starter.web.validator.group.AddGroup;
import com.ucode.springboot.starter.web.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@SuppressWarnings("serial")
@ApiModel(value="客户")
public class CustomerForm  implements Serializable{

    /**
     * 客户名称
     */
    @ApiModelProperty(value = "客户名称",required=true)
    @NotBlank(message = "客户名称不能为空", groups = {AddGroup.class,UpdateGroup.class})
    @Length(max=100,message = "客户名称最大255个字符", groups = {AddGroup.class,UpdateGroup.class})
    private String name;
    /**
     * 客户级别:1.S类,2.A类3.B类4.C类5.D类
     */
    @ApiModelProperty(value = "客户级别:1.S类,2.A类3.B类4.C类5.D类",required=false,example="2")
    @CheckMember(value={"1","2","3","4","5"},message="客户级别非法", groups = {AddGroup.class,UpdateGroup.class})
    private Integer level;
    /**
     * 客户来源
     */
    @ApiModelProperty(value = "客户来源:1.促销活动 2.搜索引擎 3.广告 4.转介绍 5.线上注册 6.线上询价 7.预约上门 8.陌拜 9.电话咨询 10.电销 100其他",required=false,example="0")
    private Integer source;
    /**
     * 客户行业
     */
    @ApiModelProperty(value = "1.互联网IT 2.金融业 3.地产/建筑业 4.服务业 5.运输/物流 6.生产制造业 7.国家党政机关 8.文化传媒业 9.生物医药业10.能源材料业 100.其他",required=false,example="0")
    private Integer industry;
    /**
     * 下次联系时间
     */
    @ApiModelProperty(value = "下次联系时间",required=false)
    private Date nextTime;
    /**
     * 网址
     */
    @ApiModelProperty(value = "网址",required=false)
    @Length(max=150,message = "网址最大长度150字符", groups = {AddGroup.class,UpdateGroup.class})
    private String website;
    /**
     * 客户备注
     */
    @ApiModelProperty(value = "备注",required=false)
    @Length(max=500,message = "备注最大长度500字符", groups = {AddGroup.class,UpdateGroup.class})
    private String remark;
    
    /**
     * 省
     */
    @ApiModelProperty(value = "省Id",required=false)
    private Integer provinceId;
    /**
     * 市
     */
    @ApiModelProperty(value = "市Id",required=false)
    private Integer cityId;
    /**
     * 区
     */
    @ApiModelProperty(value = "区Id",required=false)
    private Integer areaId;
    /**
     * 详细地址
     */
    @ApiModelProperty(value = "详细地址",required=false)
    @Length(max=255,message = "详细地址最大长度255字符", groups = {AddGroup.class,UpdateGroup.class})
    private String address;
    
    /**
     * 首要联系人
     */
    @ApiModelProperty(value = "主联系人Id(更新客户时必填)",required=false)
    @NotNull(message = "联系人Id不能为空", groups = {UpdateGroup.class})
    private Long contactsId; 
    
    /**
     * 首要联系人姓名
     */
    @ApiModelProperty(value = "首要联系人姓名",required=false)
    private String cname;
    
    /**
     * 首要联系人手机号
     */
    @ApiModelProperty(value = "首要联系人手机号",required=true)
    @NotBlank(message = "首要联系人手机号不能为空", groups = {AddGroup.class,UpdateGroup.class})
    @Pattern(regexp = "^(1[3-9])\\d{9}$",message = "首要联系人手机号格式错误", groups = {AddGroup.class,UpdateGroup.class})
    private String mobile;
    
    @ApiModelProperty(value = "首要联系人座机号",required=false)
    private String telephone;
    
    /**
     * 首要联系人性别：0 未知 1 男 2 女 
     */
    @ApiModelProperty(value = "性别:0未知1男2女",required=true,example="0",dataType="Integer")
    @NotNull(message = "首要联系人性别性别不能为空", groups = {AddGroup.class,UpdateGroup.class})
    @CheckMember(value={"0","1","2"},message="首要联系人性别性别非法", groups = {AddGroup.class,UpdateGroup.class})
    private Integer sex;
    
    /**
     * 首要联系人生日
     */
    @ApiModelProperty(value = "性别:0未知1男2女",required=false)
    private Date birthday;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Integer getSource() {
        return source;
    }

    public void setSource(Integer source) {
        this.source = source;
    }

    public Integer getIndustry() {
        return industry;
    }

    public void setIndustry(Integer industry) {
        this.industry = industry;
    }

    public Date getNextTime() {
        return nextTime;
    }

    public void setNextTime(Date nextTime) {
        this.nextTime = nextTime;
    }

    public String getWebsite() {
        return website;
    }

    public void setWebsite(String website) {
        this.website = website;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(Integer provinceId) {
        this.provinceId = provinceId;
    }

    public Integer getCityId() {
        return cityId;
    }

    public void setCityId(Integer cityId) {
        this.cityId = cityId;
    }

    public Integer getAreaId() {
        return areaId;
    }

    public void setAreaId(Integer areaId) {
        this.areaId = areaId;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Long getContactsId() {
        return contactsId;
    }

    public void setContactsId(Long contactsId) {
        this.contactsId = contactsId;
    }

    public String getCname() {
        return cname;
    }

    public void setCname(String cname) {
        this.cname = cname;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
}
